$regfile = "attiny2313.dat"                                
$crystal = 4000000                                          

Config Portb.1 = Output : Set Portd.1                      
Config Portb.4 = Output                                     
Config Portd.4 = Output
Speaker Alias Pind.4

Sound Speaker , 420 , 60
Pind.4 = 0


Do

    Debounce Pind.1 , 0 , En , Sub

    If Pinb.1 = 0 Then                                      
    Pinb.4 = 1
    Waitms 400
    Pinb.4 = 0                                            
    Else                                                 
    Pinb.4 = 0                                              
    End If

Loop



En:
Toggle Portb.1

Return